import request from '@/utils/request'

const baseUrl = '/prot/article'

/**
 * 获取词云列表
 */
export function getWordList(params) {
  return request({
    url: `${baseUrl}/getWordList`,
    method: 'get',
    params: params
  })
}

export function getArticlePage(params) {
  return request({
    url: `${baseUrl}`,
    method: 'get',
    params: params
  })
}

export function getArticleById(id) {
  return request({
    url: `${baseUrl}/${id}`,
    method: 'get'
  })
}

export function saveArticle(article) {
  return request({
    url: `${baseUrl}`,
    method: 'post',
    data: article
  })
}

export function updateArticle(article) {
  return request({
    url: `${baseUrl}`,
    method: 'put',
    data: article
  })
}
export function deleteArticleById(id) {
  return request({
    url: `${baseUrl}/${id}`,
    method: 'delete'
  })
}

export function deleteArticleBatch(ids) {
  return request({
    url: `${baseUrl}/batch`,
    method: 'delete',
    params: { ids: ids }
  })
}

